<!--
 * @Author: lwy 1245883359@qq.com
 * @Date: 2024-06-14 15:56:26
 * @LastEditors: lwy 1245883359@qq.com
 * @LastEditTime: 2024-06-15 15:25:12
 * @FilePath: \six-bird-operation-platform\src\views\worker\person\components\serviceArea.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div>
    <div class="serviceArea">
      <div
        class="item"
        v-for="(item, index) in info.slice(0, 3)"
        :key="'info_' + index"
        :style="index < 2 ? 'margin-bottom: 5px;' : ''"
      >
        <span
          class="state"
          style="padding-left: 27px"
          v-if="index > 0 && item.serviceLevel == info[index - 1].serviceLevel"
          ></span
        >
        <span class="state" v-else
          >{{ item.serviceLevel | filterAreaWeight }}：</span
        >
        <span class="name">{{ item.serviceAreaName }}</span>
      </div>
      <el-link type="primary" v-if="info.length > 3" @click="trigger"
        >展开</el-link
      >
    </div>
  </div>
</template>
<script>
export default {
  components: {},
  props: {
    info: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {
      dialogVisible: false,
    };
  },
  mounted() {},
  methods: {
    trigger() {
      this.$emit("trigger");
    },
  },
};
</script>
<style scoped lang="scss">
.serviceArea {
  max-height: 100px;
  overflow: hidden;
  text-align: left;

  .el-link {
    padding-left: 30px;
  }
}
</style>
